3.692 \(\int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx\)

Optimal. Leaf size=132 \[ \frac{a^3 c^4 (5 B+i A) (1-i \tan (e+f x))^6}{6 f}-\frac{4 a^3 c^4 (2 B+i A) (1-i \tan (e+f x))^5}{5 f}+\frac{a^3 c^4 (B+i A) (1-i \tan (e+f x))^4}{f}-\frac{a^3 B c^4 (1-i \tan (e+f x))^7}{7 f} \]

[Out]

(a^3*(I*A + B)*c^4*(1 - I*Tan[e + f*x])^4)/f - (4*a^3*(I*A + 2*B)*c^4*(1 - I*Tan[e + f*x])^5)/(5*f) + (a^3*(I*
A + 5*B)*c^4*(1 - I*Tan[e + f*x])^6)/(6*f) - (a^3*B*c^4*(1 - I*Tan[e + f*x])^7)/(7*f)

________________________________________________________________________________________

Rubi [A]  time = 0.178058, antiderivative size = 132, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.049, Rules used = {3588, 77} \[ \frac{a^3 c^4 (5 B+i A) (1-i \tan (e+f x))^6}{6 f}-\frac{4 a^3 c^4 (2 B+i A) (1-i \tan (e+f x))^5}{5 f}+\frac{a^3 c^4 (B+i A) (1-i \tan (e+f x))^4}{f}-\frac{a^3 B c^4 (1-i \tan (e+f x))^7}{7 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^4,x]

[Out]

(a^3*(I*A + B)*c^4*(1 - I*Tan[e + f*x])^4)/f - (4*a^3*(I*A + 2*B)*c^4*(1 - I*Tan[e + f*x])^5)/(5*f) + (a^3*(I*
A + 5*B)*c^4*(1 - I*Tan[e + f*x])^6)/(6*f) - (a^3*B*c^4*(1 - I*Tan[e + f*x])^7)/(7*f)

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx &=\frac{(a c) \operatorname{Subst}\left (\int (a+i a x)^2 (A+B x) (c-i c x)^3 \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (4 a^2 (A-i B) (c-i c x)^3-\frac{4 a^2 (A-2 i B) (c-i c x)^4}{c}+\frac{a^2 (A-5 i B) (c-i c x)^5}{c^2}+\frac{i a^2 B (c-i c x)^6}{c^3}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a^3 (i A+B) c^4 (1-i \tan (e+f x))^4}{f}-\frac{4 a^3 (i A+2 B) c^4 (1-i \tan (e+f x))^5}{5 f}+\frac{a^3 (i A+5 B) c^4 (1-i \tan (e+f x))^6}{6 f}-\frac{a^3 B c^4 (1-i \tan (e+f x))^7}{7 f}\\ \end{align*}

Mathematica [A]  time = 7.02557, size = 172, normalized size = 1.3 \[ \frac{a^3 c^4 \sec (e) \sec ^7(e+f x) (70 (B-i A) \cos (2 e+f x)+70 (B-i A) \cos (f x)-70 A \sin (2 e+f x)+147 A \sin (2 e+3 f x)+49 A \sin (4 e+5 f x)+7 A \sin (6 e+7 f x)+175 A \sin (f x)-70 i B \sin (2 e+f x)+21 i B \sin (2 e+3 f x)+7 i B \sin (4 e+5 f x)+i B \sin (6 e+7 f x)-35 i B \sin (f x))}{840 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^4,x]

[Out]

(a^3*c^4*Sec[e]*Sec[e + f*x]^7*(70*((-I)*A + B)*Cos[f*x] + 70*((-I)*A + B)*Cos[2*e + f*x] + 175*A*Sin[f*x] - (
35*I)*B*Sin[f*x] - 70*A*Sin[2*e + f*x] - (70*I)*B*Sin[2*e + f*x] + 147*A*Sin[2*e + 3*f*x] + (21*I)*B*Sin[2*e +
 3*f*x] + 49*A*Sin[4*e + 5*f*x] + (7*I)*B*Sin[4*e + 5*f*x] + 7*A*Sin[6*e + 7*f*x] + I*B*Sin[6*e + 7*f*x]))/(84
0*f)

________________________________________________________________________________________

Maple [A]  time = 0.012, size = 147, normalized size = 1.1 \begin{align*}{\frac{{a}^{3}{c}^{4}}{f} \left ( -{\frac{i}{7}}B \left ( \tan \left ( fx+e \right ) \right ) ^{7}-{\frac{i}{6}}A \left ( \tan \left ( fx+e \right ) \right ) ^{6}-{\frac{2\,i}{5}}B \left ( \tan \left ( fx+e \right ) \right ) ^{5}+{\frac{B \left ( \tan \left ( fx+e \right ) \right ) ^{6}}{6}}-{\frac{i}{2}}A \left ( \tan \left ( fx+e \right ) \right ) ^{4}+{\frac{A \left ( \tan \left ( fx+e \right ) \right ) ^{5}}{5}}-{\frac{i}{3}}B \left ( \tan \left ( fx+e \right ) \right ) ^{3}+{\frac{B \left ( \tan \left ( fx+e \right ) \right ) ^{4}}{2}}-{\frac{i}{2}}A \left ( \tan \left ( fx+e \right ) \right ) ^{2}+{\frac{2\,A \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{3}}+{\frac{B \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2}}+A\tan \left ( fx+e \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x)

[Out]

1/f*a^3*c^4*(-1/7*I*B*tan(f*x+e)^7-1/6*I*A*tan(f*x+e)^6-2/5*I*B*tan(f*x+e)^5+1/6*B*tan(f*x+e)^6-1/2*I*A*tan(f*
x+e)^4+1/5*A*tan(f*x+e)^5-1/3*I*B*tan(f*x+e)^3+1/2*B*tan(f*x+e)^4-1/2*I*A*tan(f*x+e)^2+2/3*A*tan(f*x+e)^3+1/2*
B*tan(f*x+e)^2+A*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.676, size = 204, normalized size = 1.55 \begin{align*} \frac{-60 i \, B a^{3} c^{4} \tan \left (f x + e\right )^{7} - 70 \,{\left (i \, A - B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{6} +{\left (84 \, A - 168 i \, B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{5} - 210 \,{\left (i \, A - B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{4} +{\left (280 \, A - 140 i \, B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{3} - 210 \,{\left (i \, A - B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{2} + 420 \, A a^{3} c^{4} \tan \left (f x + e\right )}{420 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x, algorithm="maxima")

[Out]

1/420*(-60*I*B*a^3*c^4*tan(f*x + e)^7 - 70*(I*A - B)*a^3*c^4*tan(f*x + e)^6 + (84*A - 168*I*B)*a^3*c^4*tan(f*x
 + e)^5 - 210*(I*A - B)*a^3*c^4*tan(f*x + e)^4 + (280*A - 140*I*B)*a^3*c^4*tan(f*x + e)^3 - 210*(I*A - B)*a^3*
c^4*tan(f*x + e)^2 + 420*A*a^3*c^4*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.28456, size = 506, normalized size = 3.83 \begin{align*} \frac{{\left (1680 i \, A + 1680 \, B\right )} a^{3} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} +{\left (2352 i \, A - 336 \, B\right )} a^{3} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (784 i \, A - 112 \, B\right )} a^{3} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} +{\left (112 i \, A - 16 \, B\right )} a^{3} c^{4}}{105 \,{\left (f e^{\left (14 i \, f x + 14 i \, e\right )} + 7 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 21 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 35 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 35 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 21 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x, algorithm="fricas")

[Out]

1/105*((1680*I*A + 1680*B)*a^3*c^4*e^(6*I*f*x + 6*I*e) + (2352*I*A - 336*B)*a^3*c^4*e^(4*I*f*x + 4*I*e) + (784
*I*A - 112*B)*a^3*c^4*e^(2*I*f*x + 2*I*e) + (112*I*A - 16*B)*a^3*c^4)/(f*e^(14*I*f*x + 14*I*e) + 7*f*e^(12*I*f
*x + 12*I*e) + 21*f*e^(10*I*f*x + 10*I*e) + 35*f*e^(8*I*f*x + 8*I*e) + 35*f*e^(6*I*f*x + 6*I*e) + 21*f*e^(4*I*
f*x + 4*I*e) + 7*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [B]  time = 107.986, size = 270, normalized size = 2.05 \begin{align*} \frac{\frac{\left (16 i A a^{3} c^{4} + 16 B a^{3} c^{4}\right ) e^{- 8 i e} e^{6 i f x}}{f} + \frac{\left (112 i A a^{3} c^{4} - 16 B a^{3} c^{4}\right ) e^{- 10 i e} e^{4 i f x}}{5 f} + \frac{\left (112 i A a^{3} c^{4} - 16 B a^{3} c^{4}\right ) e^{- 12 i e} e^{2 i f x}}{15 f} + \frac{\left (112 i A a^{3} c^{4} - 16 B a^{3} c^{4}\right ) e^{- 14 i e}}{105 f}}{e^{14 i f x} + 7 e^{- 2 i e} e^{12 i f x} + 21 e^{- 4 i e} e^{10 i f x} + 35 e^{- 6 i e} e^{8 i f x} + 35 e^{- 8 i e} e^{6 i f x} + 21 e^{- 10 i e} e^{4 i f x} + 7 e^{- 12 i e} e^{2 i f x} + e^{- 14 i e}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**4,x)

[Out]

((16*I*A*a**3*c**4 + 16*B*a**3*c**4)*exp(-8*I*e)*exp(6*I*f*x)/f + (112*I*A*a**3*c**4 - 16*B*a**3*c**4)*exp(-10
*I*e)*exp(4*I*f*x)/(5*f) + (112*I*A*a**3*c**4 - 16*B*a**3*c**4)*exp(-12*I*e)*exp(2*I*f*x)/(15*f) + (112*I*A*a*
*3*c**4 - 16*B*a**3*c**4)*exp(-14*I*e)/(105*f))/(exp(14*I*f*x) + 7*exp(-2*I*e)*exp(12*I*f*x) + 21*exp(-4*I*e)*
exp(10*I*f*x) + 35*exp(-6*I*e)*exp(8*I*f*x) + 35*exp(-8*I*e)*exp(6*I*f*x) + 21*exp(-10*I*e)*exp(4*I*f*x) + 7*e
xp(-12*I*e)*exp(2*I*f*x) + exp(-14*I*e))

________________________________________________________________________________________

Giac [B]  time = 2.08271, size = 309, normalized size = 2.34 \begin{align*} \frac{1680 i \, A a^{3} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + 1680 \, B a^{3} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + 2352 i \, A a^{3} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} - 336 \, B a^{3} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + 784 i \, A a^{3} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} - 112 \, B a^{3} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + 112 i \, A a^{3} c^{4} - 16 \, B a^{3} c^{4}}{105 \,{\left (f e^{\left (14 i \, f x + 14 i \, e\right )} + 7 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 21 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 35 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 35 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 21 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x, algorithm="giac")

[Out]

1/105*(1680*I*A*a^3*c^4*e^(6*I*f*x + 6*I*e) + 1680*B*a^3*c^4*e^(6*I*f*x + 6*I*e) + 2352*I*A*a^3*c^4*e^(4*I*f*x
 + 4*I*e) - 336*B*a^3*c^4*e^(4*I*f*x + 4*I*e) + 784*I*A*a^3*c^4*e^(2*I*f*x + 2*I*e) - 112*B*a^3*c^4*e^(2*I*f*x
 + 2*I*e) + 112*I*A*a^3*c^4 - 16*B*a^3*c^4)/(f*e^(14*I*f*x + 14*I*e) + 7*f*e^(12*I*f*x + 12*I*e) + 21*f*e^(10*
I*f*x + 10*I*e) + 35*f*e^(8*I*f*x + 8*I*e) + 35*f*e^(6*I*f*x + 6*I*e) + 21*f*e^(4*I*f*x + 4*I*e) + 7*f*e^(2*I*
f*x + 2*I*e) + f)